﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SkladLib
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class SkladWin : Window
    {
        public SkladWin()
        {
            InitializeComponent();
            InterfacePolozka.AddedRow += InterfacePolozka_AddedRow;
           
        }

        void InterfacePolozka_AddedRow(object sender)
        {
            listViewSklad.refresh();
        }

        private void listViewSklad_Loaded(object sender, RoutedEventArgs e)
        {
          //  Zbozi zzz = Zbozi.GetZboziByCode("455A");   poze na testovani
            
        }

        private void Window_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            switch (e.Text)
            {
                case "-":
                    InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new CultureInfo("en-US"));
                    e.Handled = true;
                    break;
                case "(":
                    InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new CultureInfo("cs-CZ"));
                    e.Handled = true;
                    break;
            }
        }
    }
}
